import request from "@/utils/request";
import type {
  loginFormData,
  loginResponseData,
  userInfoReponseData,
} from "./type";

enum API {
  LOGIN = "/user/login",
  USERINFO = "/user/info",
  ROUTER = "/getRouter",
}

// 登录
export const reqLogin = (data: loginFormData) =>
  request.post<any, loginResponseData>(API.LOGIN, data);

// 获取用户信息
export const reqUserInfo = () =>
  request.get<any, userInfoReponseData>(API.USERINFO);

export const getAuthMenuList = () => request.get<any, any>(API.ROUTER);
